<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="ru" />
<title>Отчет о наличии материалов на складе</title>
<STYLE type="text/css">
body {
	font: 10pt Tahoma,Arial,Helvetica,sans-serif; 
	color: #222222
}
table td {
	vertical-align:baseline;
}
.manplan-code {
}
.manplan-descr-1 {
	font-size:10pt;
	white-space:normal;
}
.manplan-descr-2 {
	font-size:8pt;
	white-space:normal;
}
.manplan-amount {
	text-align:right;
	padding-left: 10pt;
	white-space:nowrap;
}
.manplan-opt-amount {
	text-align:left;
	white-space:nowrap;
}
.manplan-pcs {
	text-align:left;
	white-space:nowrap;
}
.manplan-metric {
	text-align:right;
	white-space:nowrap;
}
.manplan-opt-metric {
	text-align:left;
	white-space:nowrap;
}
.manplan-title {
	font-weight:700;
	text-align:center;
	background-color:#dddddd
}
</STYLE>

</head>

<body>
	<h2>Отчет о наличии материалов на складе</h2>
	<h3>Список, запланированных к производству изделий</h3>
	<table>
	{foreach $data->article as $entry}
		<tr>
			<td>{$entry@index + 1}</td>
			<td class="manplan-code">{$entry->code}</td>
			<td class="manplan-descr-1">{$entry->descr}</td>
			<td class="manplan-amount">{$entry->amount}</td>
			<td class="manplan-pcs">{$entry->met_name}</td>
		</tr>
	{/foreach}
	</table>
	<h3>Наличие на складе материалов</h3>
	<table>
		<tr>
			<td class="manplan-title">№</td>
			<td class="manplan-title">Шифр</td>
			<td class="manplan-title">Наименование</td>
			<td colspan="2" class="manplan-title">Спецификация</td>
			<td colspan="2" class="manplan-title">Склад</td>
			<td colspan="2" class="manplan-title">Дефицит</td>
			<td colspan="2" class="manplan-title">Метрика</td>
		</tr>
	{foreach $data->unit as $entry}
		<tr>
			<td>{$entry@index + 1}</td>
			<td class="manplan-code" {if $entry->diff gt 0}style="text-decoration:underline"{/if}>{$entry->code}</td>
			<td class="manplan-descr-2">{$entry->descr}</td>
			<td class="manplan-amount">{$entry->amount|string_format:"%.2f"}</td>
			<td class="manplan-opt-amount">/{$entry->opt_amount|string_format:"%.2f"}</td>
			<td class="manplan-amount">{$entry->stock|string_format:"%.2f"}</td>
			<td class="manplan-opt-amount">/{$entry->opt_stock|string_format:"%.2f"}</td>
			<td class="manplan-amount">{$entry->diff|string_format:"%.2f"}</td>
			<td class="manplan-opt-amount">/{$entry->opt_diff|string_format:"%.2f"}</td>
<!--		<td class="manplan-opt-amount">{if $entry->opt_met_id ne 0}/{$entry->opt_diff|string_format:"%.2f"}{else}/0{/if}</td> -->
			<td class="manplan-metric">{$entry->met_name}</td>
			<td class="manplan-opt-metric">/{$entry->opt_met_name}</td>
		</tr>
	{/foreach}
	</table>	
</body>
</html>
